<?php
namespace Vido\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
    
        $this->display();
    }
   public function add_list(){
            $value = session('user');
            if(!$value){
            	$this->error("请登录",U('/Vido/Admin/index'));
            		 return; 
            }
	      echo $value;
 return; 
           $Cheng=D('add');//表名
            $data['title']=I('title');
            $data['img_src']=I('img_src');
            $data['vodio_src']=I('vodio_src');
			
			/*$upload = new \Think\Upload();// 实例化上传类
   			$upload->maxSize   =     0 ;// 设置附件上传大小
    	    $upload->exts      =     array('jpg', 'gif', 'png', 'jpeg','mp4','rmvb');// 设置附件上传类型
   		    $upload->rootPath  =     'D:/nginx-1.9.7/html/'; // 设置附件上传根目录
   		    $upload->savePath  =     '/img'; // 设置附件上传（子）目录
    		// 上传文件 
    		$info   =   $upload->upload();
   			 if(!$info) {// 上传错误提示错误信息
      			  $this->error($upload->getError());
  			  }else{// 上传成功
  			 	 foreach($info as $file){
        			echo $file['savepath'].$file['savename'];
   				 }
     		  $this->success($info['savePath'].$info['savename'],'',10000);
   			
   			 }*/
	
	
			          //添加到数据库
       
			if ($Cheng->create($data)){ 
     		    if($Cheng->add()){
     		    	
     		    	$this->success('数据添加成功',U('add_vodi'),1000);
     		    }else{
     		    	$this->error("数据添加失败");
     		    }
     		   
			}else{
			
			$this->error($Cheng->getError());
    		
			}


          
		
    }
     public function add_vodi(){
     	   $test['id']=100;
		   $test['name']='程国庆';
		   $this->assign('qing',$test); 
		   
		 $cate=D('add');
         $cates=$cate->select();
         $this->assign('cates',$cates); 
	
     	 $this->display();
     }
	public function ajax(){

		 $cate=M('add');
		 $id_p['id']=57; 
         $cate->where($id_p)->delete();
	 /*   $this->ajaxReturn($cates);*/
	}
/**
 * 生成二维码
 * @param  string  $url  url连接
 * @param  integer $size 尺寸 纯数字
 */
function kmn(){
	
  $umg_opi=qrcode(i('url'),10);

}

public function uo_oss(){
	
// 如果群发邮件 则传入数组即可
$emails=array('511900203@qq.com');
send_email($emails,'注册认证','验证码为515235416');
}

public function fuwenben(){
  $this->display();
}


}